home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / thor_api / common / openbrlib2.c < prev    next >
C/C++ Source or Header  |  1996-08-05  |  696b  |  38 lines

  1. /* OpenThorLib.c
  2.  
  3.     Auto: SC <path>OpenBRLib2.c NOSTKCHK IDIR src:bbsread/include DEBUG FULL
  4. */
  5. #define __USE_SYSBASE   1
  6.  
  7. #include <exec/types.h>
  8. #include <proto/exec.h>
  9. #include <proto/dos.h>
  10. #include <libraries/dos.h>
  11.  
  12. #include    <libraries/bbsread.h>
  13.  
  14.  
  15. struct Library *OpenBRLibrary(
  16. struct ExecBase *SysBase,
  17. struct DosLibrary *DOSBase,
  18. STRPTR libName,
  19. LONG version)
  20. {
  21.     TEXT envbuf[256];
  22.     struct Library *libBase = NULL;
  23.  
  24.     if(GetVar(ENV_THORPATH, envbuf, 256, GVF_GLOBAL_ONLY))
  25.     {
  26.         if(AddPart(envbuf, "libs", 256))
  27.         {
  28.             if(AddPart(envbuf, libName, 256))
  29.             {
  30.                 libBase = OpenLibrary(envbuf, version);
  31.             }
  32.         }
  33.     }
  34.     if(!libBase) libBase = OpenLibrary(libName, version);
  35.  
  36.     return(libBase);
  37. }
  38.